package com.mmp.main.entity;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * The persistent class for the lookup_scrapping_reason database table.
 *
 */
@Entity
@Table(name = "lookup_scrapping_reason")
@NamedQuery(name = "LookupScrappingReason.findAll", query = "SELECT l FROM LookupScrappingReason l WHERE l.status=true ORDER BY l.name ")
public class LookupScrappingReason implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Basic(optional = false)
	private Integer id;

	private String name;

	private Boolean status;

	// bi-directional many-to-one association to HospitalDeviceScrappingInfo
	@OneToMany(mappedBy = "lookupScrappingReason")
	private List<HospitalDeviceScrappingInfo> hospitalDeviceScrappingInfos;

	public LookupScrappingReason() {
	}

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Boolean getStatus() {
		return this.status;
	}

	public void setStatus(Boolean status) {
		this.status = status;
	}

	public List<HospitalDeviceScrappingInfo> getHospitalDeviceScrappingInfos() {
		return this.hospitalDeviceScrappingInfos;
	}

	public void setHospitalDeviceScrappingInfos(List<HospitalDeviceScrappingInfo> hospitalDeviceScrappingInfos) {
		this.hospitalDeviceScrappingInfos = hospitalDeviceScrappingInfos;
	}

	public HospitalDeviceScrappingInfo addHospitalDeviceScrappingInfo(
			HospitalDeviceScrappingInfo hospitalDeviceScrappingInfo) {
		getHospitalDeviceScrappingInfos().add(hospitalDeviceScrappingInfo);
		hospitalDeviceScrappingInfo.setLookupScrappingReason(this);

		return hospitalDeviceScrappingInfo;
	}

	public HospitalDeviceScrappingInfo removeHospitalDeviceScrappingInfo(
			HospitalDeviceScrappingInfo hospitalDeviceScrappingInfo) {
		getHospitalDeviceScrappingInfos().remove(hospitalDeviceScrappingInfo);
		hospitalDeviceScrappingInfo.setLookupScrappingReason(null);

		return hospitalDeviceScrappingInfo;
	}

}
